<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title><!--装机单--></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" href="css/project/ui-res-v3.css">
    <link rel="stylesheet" href="css/project/ui-input-v3.css">
    <link rel="stylesheet" href="css/project/ui-color-v3.css">
	<link rel="stylesheet" href="css/project/style.css">
    <link rel="stylesheet" href="css/ui-base.css">
    <link rel="stylesheet" href="css/ui-box.css">
	<link rel="stylesheet" href="css/zv_common.css">
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/zy_json.js"></script>
<script src="js/main.js"></script>
<script src="js/init.js"></script>
<script type="text/javascript" src="js/JsonSQL/jsonsql-0.1.js"></script>
<script src="js/talkingdata.js"></script>
<script>
		window.uexOnload=function(type){
			if(!type){
				uexWindow.setBounce("0");
			}
		}
</script>
<style type="text/css">
.zv_imcline{  background:#789de2; color:#fff; border-right:1px solid #fff;}
.zv_imcline1{color:#333333; border-bottom:1px solid #789de2; border-left:1px solid #789de2;}
.zv_imcline2{ border-right:1px solid #789de2;}
.zv_imcline3{border:1px solid #789de2; background:#ffcc00;}
.zv_issline{background:#003079; color:#fff; border-right:1px solid #fff;}
.zv_isslinegr{background:#d8d8d8; color:#003079; border-right:1px solid #fff;}
	 /*弹出框内样式 */
	#alert_coverDiv {background: #000000;width: 100%;height: 100%;opacity: 0.5;filter: alpha(opacity = 50);position:fixed;top: 0px;z-index: 999;display:none; }
#alert_dialogbox { width: 90%;background:#003079;border-radius: 0.5em;height: 60%;overflow: hidden;margin: 0 auto;position: fixed;z-index: 9999;opacity: 0.9;filter: alpha(opacity = 90);top: 20%;}
#alert_dialogcontent {overflow: scroll;padding: 0.3em;background:#fff; margin-left:0.3em; margin-right:0.3em; height:70%; line-height:1.8em}
#alert_down {padding: 0.3em;background:#fff; margin-left:0.3em; margin-right:0.3em; height:2em; line-height:2em; text-align:center;}
#alert_dialogboxout {width: 90%;margin: 0 auto;position: relative;top: 15%;z-index: 99999;display:none;}
#alert_title{height:2.2em; line-height:2.2em; color:#fff; text-align:center;}
</style>
</head>
<body class="um-vp c-wh" ontouchstart>
<div id="alert_DialogBox_html"></div>
<div id="body_content" >	
<div class="ub ub-ver" >
	<div class="ub-ac ub uinn1 umar-t">
    	<div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c" style=" letter-spacing:0.2em;">航班号</div>
			<div class="zv_h1 zv_imcline1 tx-c"  id="FLIGHT_NO">&nbsp;</div>
		</div>
        <div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c" style=" letter-spacing:0.2em;">航　段</div>
			<div class="zv_h1 zv_imcline1 tx-c" id="DEP_AIRPORT">&nbsp;</div>
		</div>	
        <div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c " style=" letter-spacing:-0.1em;" id="planDept_name">&nbsp;</div>
			<div class="zv_h1 zv_imcline1 tx-c" id="planDeptTime">&nbsp;</div>
		</div>	
		<div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c " style=" letter-spacing:0.1em;">版本号</div>
			<div class="zv_h1 zv_imcline1 zv_imcline2 tx-c" id="VERSION">
				<div class="ub-f1 ub uba  b-gra  sel noboder">
			        <div class="ub-f1 ut-s tx-l t-gra ulh-sel"  style="font-weight:normal; text-align:center; height:2em; line-height:2.2em; font-size:0.9em;" id="version_number_val">&nbsp;</div>
			        <div class="b-gra  ub ub-pc ub-ac">
			            <div class="ub-img umh1 res3" style="width:0.8em"></div>
			        </div>
			          <select name="version_number" selectedindex="0"  id="version_number" onchange="zv_wanggongmin(this.id)"></select>
			    </div>
			</div>
		</div>	
    </div>
    <div class="ub-ac ub uinn1 umar-t">
    	<div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c" style=" letter-spacing:-0.1em;">机号/机型</div>
			<div class="zv_h1 zv_imcline1 tx-c"><span  id="AC_TYPE">&nbsp;</span>/<span  id="tailNo">&nbsp;</span></div>
		</div>
        <div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c" style=" letter-spacing:0.2em;">桥　位</div>
			<div class="zv_h1 zv_imcline1 tx-c"><!--<span  id="ARR_AC_LOC">&nbsp;</span>/--><span  id="DEPT_AC_LOC">&nbsp;</span></div>
		</div>	
        <div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c " style=" letter-spacing:0.1em;">制单人</div>
			<div class="zv_h1 zv_imcline1  tx-c" id="USER_NAME">&nbsp;</div>
		</div>	
		  <div class="ub ub-ver ub-f1"  style="width:25%">
			<div class="uc-t zv_h1 zv_imcline tx-c " style=" letter-spacing:0em;">创建时间</div>
			<div class="zv_h1 zv_imcline1 zv_imcline2 tx-c" id="CREATE_TIME">&nbsp;</div>
		</div>	
    </div>	
	<div id="warehouse_bek" style="display:none;">
	</div>
	<div id="warehouse" class="umar-t">
	</div>
	
	<div id="version" class="umar-t">
	</div>
	 <div class="ub-ac uinn1 umar-t ub-ver">
    	<div class="ub">
            <div class="uc-t ub-f1 zv_h1 zv_isslinegr tx-l zv_bblue">&nbsp;&nbsp;出港备注</div>
		</div>
        <div class="ub" >
			<div class="zv_imcline1 tx-l" style=" border:1px solid #003079; width:99.5%; line-height:1.8em"  id="LOADSHEET_REMARK" >&nsub;</div>
		</div>	
    </div>
	<div style="height:0.5em"></div>
	<input type="hidden" id="Installed_single_id">
</div>
</div>
</body>
<script>
zy_init();
window.uexOnload=function(type){
	Loading(0);
	if(!type){
		uexWindow.setBounce("0");
		IC.talkingDataCount("装机单","0020");
	}
	var  screen_Height=document.body.clientHeight
	document.getElementById("body_content").style.height=screen_Height+'px';
	document.getElementById("body_content").style.overflow='auto';
	installed_single();
}
function zv_wanggongmin(id){
	IC.talkingDataCount("装机单","0020");
    var sl = document.getElementById(id);
	    if (sl) {
        var sp = sl.parentElement; //<span>
        if (sp) {
            var ch = sp.getElementsByTagName("div")[0];
            var t = sl.options[sl.selectedIndex].text;
            if (ch) {
                ch.innerHTML = t;
            }
			VERSION
			zv_version()
        }
    }
}
function zv_version(){//版本号选择
	IC.talkingDataCount("装机单","0020");
	Loading(0);
	var version_number 	= $$("version_number").value;/*版本号*/
	var installed_carrier=localStorage.getItem("installed_carrier");
	var installed_flightNo=localStorage.getItem("installed_flightNo");
	var installed_pdate=localStorage.getItem("installed_pdate");
	var installed_dept=localStorage.getItem("installed_dept");
	var installed_arr=localStorage.getItem("installed_arr");
	var jump_url="installed_single_list"
	var installed_refresh_type=localStorage.getItem("installed_refresh_type");
	if(installed_refresh_type=='1')
	{
		jump_url='installed_single_search'
	}
	ueppscript(jump_url,"content","LoadDataversion('"+installed_carrier+"','"+installed_flightNo+"','"+installed_pdate+"','"+installed_dept+"','"+installed_arr+"','"+version_number+"')");
}
function myrefresh()
{
    // window.location.reload();
	var installed_carrier=localStorage.getItem("installed_carrier");
	var installed_flightNo=localStorage.getItem("installed_flightNo");
	var installed_pdate=localStorage.getItem("installed_pdate");
	var installed_dept=localStorage.getItem("installed_dept");
	var installed_arr=localStorage.getItem("installed_arr");
	var jump_url="installed_single_list"
	var installed_refresh_type=localStorage.getItem("installed_refresh_type");
	if(installed_refresh_type=='1')
	{
		jump_url='installed_single_search'
	}
	ueppscript(jump_url,"content","LoadDataSreload('"+installed_carrier+"','"+installed_flightNo+"','"+installed_pdate+"','"+installed_dept+"','"+installed_arr+"')");
}
function installed_single_v()
{
	IC.talkingDataCount("装机单","0020");
    var installed =localStorage.getItem("zvData")
	installed=installed.replace('[[', '[') 
	installed=installed.replace(']]', ']') 
	var installeddata = strToJson(installed)
	VERSION=installeddata[0].VERSION//第一次数据
	var installed_v = localStorage.getItem("zvDatareload")
	installed_v=installed_v.replace('[[', '[') 
	installed_v=installed_v.replace(']]', ']') 
	var installed_v_data = strToJson(installed_v)
	VERSION_v=installed_v_data[0].VERSION//第二次数据
	if(VERSION==VERSION_v)
	{
		 setTimeout('myrefresh()',60000)//1分钟刷新一次
	}
	else
	{
		 installed_single(1)
	}
}
function installed_single(type){
	IC.talkingDataCount("装机单","0020");
	$$("warehouse").style.display='block';
    $$("version").style.display='none';
	var Installed_single_id='';//所有装机单ID
	var jsonmodels = localStorage.getItem("jsonmodels")
	var jsonmodelsdata = strToJson(jsonmodels)
	var dataList=jsonmodelsdata[0].dataList
	var AC_TYPE=dataList[0].AC_TYPE
	if(AC_TYPE!='')
	{
		$$("AC_TYPE").innerHTML =AC_TYPE;//机型
	}
	var tailNo=dataList[0].tailNo
	if(tailNo!='')
	{
		$$("tailNo").innerHTML =tailNo;//机号
	}
	var tailNo=dataList[0].tailNo
	if(tailNo!='')
	{
		$$("tailNo").innerHTML =tailNo;//机号
	}
	var ARR_AC_LOC=dataList[0].ARR_AC_LOC
//	if(ARR_AC_LOC!='')
//	{
//		$$("ARR_AC_LOC").innerHTML =ARR_AC_LOC;//进港桥位
//	}
	var DEPT_AC_LOC=dataList[0].DEPT_AC_LOC
	if(DEPT_AC_LOC!='')
	{
		$$("DEPT_AC_LOC").innerHTML =DEPT_AC_LOC;//出港桥位
	}
	else
	{
		$$("DEPT_AC_LOC").innerHTML =ARR_AC_LOC;//进港桥位
	}
	
	var	planDeptTime=dataList[0].estDeptTime
	var   planDept_name='预计起飞'
	if(planDeptTime==''||planDeptTime=='null'||planDeptTime=='undefined'||planDeptTime==undefined)
	{
		planDeptTime=dataList[0].planDeptTime
		planDept_name='计划起飞'
	}
	$$("planDept_name").innerHTML =planDept_name;//预计/计划起飞名称
	if(planDeptTime!='')
	{
		planDeptTime=planDeptTime.split(" "); //字符分割 
		planDeptTime=planDeptTime[1]
		if(planDeptTime!='')
		{
			planDeptTime=planDeptTime.split(":"); //字符分割 
			planDeptTime=planDeptTime[0]+":"+planDeptTime[1]
		}
		$$("planDeptTime").innerHTML =planDeptTime;//计划起飞时间
	}
	var installed =localStorage.getItem("zvData")
	if(type==1)/////////////////////刷新后
	{
		installed = localStorage.getItem("zvDatareload")
	}
	installed=installed.replace('[[', '[') 
	installed=installed.replace(']]', ']') 
	var installeddata = strToJson(installed)
	var CARRIER=installeddata[0].CARRIER
	var FLIGHT_NO=installeddata[0].FLIGHT_NO
	if(FLIGHT_NO!='')
	{
		$$("FLIGHT_NO").innerHTML =CARRIER+FLIGHT_NO;//航班号
	}
	var DEP_AIRPORT=installeddata[0].DEP_AIRPORT
	var ARR_AIRPORT=installeddata[0].ARR_AIRPORT
	if(DEP_AIRPORT!='')
	{
		$$("DEP_AIRPORT").innerHTML =DEP_AIRPORT+"-"+ARR_AIRPORT;//航段
	}
	
	var VERSION=installeddata[0].VERSION
	if(VERSION!='')
	{
		var VERSION_int=parseInt(VERSION)
		if(VERSION_int>1)
		{
			var strx=''
			for (var b=1;b<=VERSION_int;b++)
			{
				var VERSION_C=b
				if(b<10)
				{
					VERSION_C="0"+VERSION_C
				}
				var selected=''
				if(b==VERSION_int)
				{
				selected='selected=selected'	
				}
				strx+='<option value="'+VERSION_C+'"  '+selected+'>ED NO:'+VERSION_C+'</option>'
			}
			$$("version_number").innerHTML =strx//版本号
			$$("version_number_val").innerHTML ="ED NO:"+VERSION//默认版本号
		}
		else
		{
			$$("VERSION").innerHTML ="ED NO:"+VERSION//版本号
		}
	}
	var LOADSHEET_REMARK=installeddata[0].LOADSHEET_REMARK
	if(LOADSHEET_REMARK!='')
	{
		$$("LOADSHEET_REMARK").innerHTML ='<span style="padding:0 0.5em;"  onclick="DialogBox1(1,\''+LOADSHEET_REMARK+'\',\'出港备注\')">'+LOADSHEET_REMARK+'</span>'//出港备注
	}
	var USER_NAME=installeddata[0].USER_NAME
	if(USER_NAME!='' && USER_NAME!='null'&&USER_NAME!=undefined&&USER_NAME!='undefined')
	{
		$$("USER_NAME").innerHTML =USER_NAME;//制单人
	}
	var CREATE_TIME=installeddata[0].CREATE_TIME
	if(CREATE_TIME!=''  && CREATE_TIME!='null'&&CREATE_TIME!=undefined&&CREATE_TIME!='undefined')
	{
		CREATE_TIME=CREATE_TIME.split("T"); //字符分割 
		CREATE_TIME=CREATE_TIME[1]
		if(CREATE_TIME!='')
		{
			CREATE_TIME=CREATE_TIME.split(":"); //字符分割 
			CREATE_TIME=CREATE_TIME[0]+":"+CREATE_TIME[1]
		}
		$$("CREATE_TIME").innerHTML =CREATE_TIME;//创建时间
	}
	var strx=''
	var current_id=''
	var current_json = strToJson(installed);

	for (var i = 0; i < current_json.length; i++) {
	 current_id+=';'+current_json[i].LOCATION_ID
	}
	JosnStr = "{\"data\": {\"items\":"+installed+"}}";
	var json = strToJson(JosnStr);
	for(var h=1;h<=5;h++)
	{
		var COMP_NAMEs=''
		var GROSS_LOADED_WEIGHT_KGs=0
		var alerts=''
		var data = jsonsql.query("select * from json.data.items where (COMP_NAME==" +h+ " )", json);
		var COMP_NAMEp=''
		if(data.length<1)
		{
			COMP_NAMEs='<span style="padding:0 0.5em;">N</span>'
			alerts='N'
		}
		else
		{
			for (var i = 0; i < data.length; i++) 
			{
				var tr=''
				if(i!=0)
				{
				 tr=	' \n '
				}
				var IS_TRANSIT=''
				if(data[i].IS_TRANSIT=='Y'||data[i].IS_TRANSIT=='y')
				{
					IS_TRANSIT='TR/'
				}
				var ULD_SERIAL=data[i].ULD_SERIAL
				if(ULD_SERIAL==null || ULD_SERIAL=='null' ||  ULD_SERIAL=='undefined' || ULD_SERIAL==undefined ||ULD_SERIAL=='')
				{
					ULD_SERIAL=''
				}
		
				var SPEC_LOAD_CODE=data[i].SPEC_LOAD_CODE
				if(SPEC_LOAD_CODE==null || SPEC_LOAD_CODE=='null' ||  SPEC_LOAD_CODE=='undefined' || SPEC_LOAD_CODE==undefined || SPEC_LOAD_CODE=='' )
				{
					SPEC_LOAD_CODE=''
				}
				else
				{
					SPEC_LOAD_CODE="/"+SPEC_LOAD_CODE;	
				}
				
				var ULD_COMPANY=data[i].ULD_COMPANY
				if(ULD_COMPANY==null || ULD_COMPANY=='null' ||  ULD_COMPANY=='undefined' || ULD_COMPANY==undefined || ULD_COMPANY=='' )
				{
					ULD_COMPANY=''
				}
				var ULD_TYPE=data[i].ULD_TYPE
				if(ULD_TYPE==null || ULD_TYPE=='null' ||  ULD_TYPE=='undefined' || ULD_TYPE==undefined || ULD_TYPE=='' )
				{
					ULD_TYPE=''
				}
				else
				{
					ULD_TYPE=ULD_TYPE.replace('/BLK',''); //字符替换 
					ULD_TYPE=ULD_TYPE+'&nbsp;';
				}
				var bg_class='';
				alerts+=IS_TRANSIT+data[i].LOCATION_ID+':'+data[i].CARGO_ARRAIRPORT+'/'+data[i].LOAD_INFO_CODE+'&nbsp;'+ULD_TYPE+ULD_SERIAL+''+ULD_COMPANY+'/'+data[i].GROSS_LOADED_WEIGHT_KG+'KG'+SPEC_LOAD_CODE+' '
				////////////////此处判断////////////////////////
				GROSS_LOADED_WEIGHT_KGs+=parseFloat(data[i].GROSS_LOADED_WEIGHT_KG);
				Installed_single_id+=';'+data[i].LOCATION_ID
				if(type==1)
				{
					var  Installed_single_idAll=$$("Installed_single_id").value;
					if (Installed_single_idAll.indexOf(data[i].LOCATION_ID) < 0)
					{
						bg_class=' style="background-color:#F00"'// 一分钟后刷新如果多一条数据显示红色
					}
					else
					{
						var  Installed_single_content_id=$$(data[i].LOCATION_ID+i).value;
						if(Installed_single_content_id!=IS_TRANSIT+data[i].LOCATION_ID+data[i].CARGO_ARRAIRPORT+data[i].LOAD_INFO_CODE+data[i].ULD_TYPE+data[i].ULD_SERIAL+data[i].ULD_COMPANY+data[i].GROSS_LOADED_WEIGHT_KG+data[i].SPEC_LOAD_CODE)
						{
							bg_class=' style="background-color:#F00"'// 一分钟后刷新如果数据修改了显示红色
						}
					}
					var Installed_id_split =Installed_single_idAll.split(";");
					COMP_NAMEp=''
					for (var p = 0; p < Installed_id_split.length; p++) {
						if (current_id.indexOf(Installed_id_split[p])<0)
						{
							var  Installed_value_split=$$(Installed_id_split[p]+'a').innerHTML;//获取删除的数据
							var  del_h=$$(Installed_id_split[p]+'H').value;//获取删除数据所在几H
							if(h==del_h)
							{
								COMP_NAMEp+='<table width="100%" border="0" cellspacing="0" cellpadding="0"   style="background-color:#F00;text-decoration:line-through;" >'+Installed_value_split+'</table>'///////删除变颜色
							}
						}
					}
				}
				var Installed_value= IS_TRANSIT+data[i].LOCATION_ID+data[i].CARGO_ARRAIRPORT+data[i].LOAD_INFO_CODE+data[i].ULD_TYPE+data[i].ULD_SERIAL+data[i].ULD_COMPANY+data[i].GROSS_LOADED_WEIGHT_KG+data[i].SPEC_LOAD_CODE
				COMP_NAMEs+='<table width="100%" border="0" cellspacing="0" cellpadding="0"  '+bg_class+' id="'+data[i].LOCATION_ID+'a"><tr><td width="33.3%"  align="center">'+IS_TRANSIT+data[i].LOCATION_ID+':'+data[i].CARGO_ARRAIRPORT+'/'+data[i].LOAD_INFO_CODE+'</td><td width="33.3%"  align="center">'+ULD_TYPE+ULD_SERIAL+'</td><td width="33.3%"  align="center">'+ULD_COMPANY+'/'+data[i].GROSS_LOADED_WEIGHT_KG+'KG'+SPEC_LOAD_CODE+'<input type="hidden" id="'+data[i].LOCATION_ID+i+'" value="'+Installed_value+'"><input type="hidden" id="'+data[i].LOCATION_ID+'H" value="'+h+'"></td></tr></table>'
			}
		}
		strx+='<div class="ub-ac uinn1 umar-t ub-ver">' 
	    strx+='<div class="ub">'
		strx+='<div class="uc-t ub-f1 zv_h1 zv_issline tx-c " style=" width:50%">'+h+'H</div>'
	    strx+='<div class="uc-t ub-f1 zv_h1 zv_isslinegr tx-c zv_bblue" style=" width:50%">'+GROSS_LOADED_WEIGHT_KGs+'</div>'
		strx+='</div>'
	    strx+='<div class="ub" onclick="DialogBox1(1,\''+alerts+'\',\''+h+'H'+'\')">'
		strx+='<div style=" border:1px solid #003079; width:99.5%;line-height:1.8em">'
		strx+=COMP_NAMEs+COMP_NAMEp
		strx+='</div>'
		strx+='</div>'
	   	strx+='</div>'
	}
	$$("warehouse").innerHTML=strx;
	if(type!=1)
	{
		$$("Installed_single_id").value=Installed_single_id;
		$$("warehouse_bek").innerHTML=strx;
	}
	setTimeout('myrefresh()',60000)//一分钟后执行myrefresh方法
	Loading(-1);
}


function installed_version(){
	IC.talkingDataCount("装机单","0020");
	$$("version").style.display='block';
    $$("warehouse").style.display='none';
	var installed =localStorage.getItem("zvDataversion")
	installed=installed.replace('[[', '[') 
	installed=installed.replace(']]', ']') 
	var installeddata = strToJson(installed)
	var CARRIER=installeddata[0].CARRIER
	var FLIGHT_NO=installeddata[0].FLIGHT_NO
	if(FLIGHT_NO!='')
	{
		$$("FLIGHT_NO").innerHTML =CARRIER+FLIGHT_NO;//航班号
	}
	var DEP_AIRPORT=installeddata[0].DEP_AIRPORT
	var ARR_AIRPORT=installeddata[0].ARR_AIRPORT
	if(DEP_AIRPORT!='')
	{
		$$("DEP_AIRPORT").innerHTML =DEP_AIRPORT+"-"+ARR_AIRPORT;//航段
	}
	var LOADSHEET_REMARK=installeddata[0].LOADSHEET_REMARK
	if(LOADSHEET_REMARK!='')
	{
		$$("LOADSHEET_REMARK").innerHTML ='<span style="padding:0 0.5em;"  onclick="DialogBox1(1,\''+LOADSHEET_REMARK+'\',\'出港备注\')">'+LOADSHEET_REMARK+'</span>'//出港备注
	}
	var USER_NAME=installeddata[0].USER_NAME
	if(USER_NAME!='' && USER_NAME!='null'&&USER_NAME!=undefined&&USER_NAME!='undefined')
	{
		$$("USER_NAME").innerHTML =USER_NAME;//制单人
	}
	var CREATE_TIME=installeddata[0].CREATE_TIME
	if(CREATE_TIME!=''  && CREATE_TIME!='null'&&CREATE_TIME!=undefined&&CREATE_TIME!='undefined')
	{
		CREATE_TIME=CREATE_TIME.split("T"); //字符分割 
		CREATE_TIME=CREATE_TIME[1]
		if(CREATE_TIME!='')
		{
			CREATE_TIME=CREATE_TIME.split(":"); //字符分割 
			CREATE_TIME=CREATE_TIME[0]+":"+CREATE_TIME[1]
		}
		$$("CREATE_TIME").innerHTML =CREATE_TIME;//创建时间
	}
	var strx=''
	var current_id=''
	var current_json = strToJson(installed);
	for (var i = 0; i < current_json.length; i++) {
	 current_id+=';'+current_json[i].LOCATION_ID
	}
	JosnStr = "{\"data\": {\"items\":"+installed+"}}";
	var json = strToJson(JosnStr);
	for(var h=1;h<=5;h++)
	{
		var COMP_NAMEs=''
		var GROSS_LOADED_WEIGHT_KGs=0
		var alerts=''
		var data = jsonsql.query("select * from json.data.items where (COMP_NAME==" +h+ " )", json);
		var COMP_NAMEp=''
		if(data.length<1)
		{
			COMP_NAMEs='<span style="padding:0 0.5em;">N</span>'
			alerts='N'
		}
		else
		{
			for (var i = 0; i < data.length; i++) 
			{
				var tr=''
				if(i!=0)
				{
				 tr=	' \n '
				}
				var IS_TRANSIT=''
				if(data[i].IS_TRANSIT=='Y'||data[i].IS_TRANSIT=='y')
				{
					IS_TRANSIT='TR/'
				}
				var ULD_SERIAL=data[i].ULD_SERIAL
				if(ULD_SERIAL==null || ULD_SERIAL=='null' ||  ULD_SERIAL=='undefined' || ULD_SERIAL==undefined ||ULD_SERIAL=='')
				{
					ULD_SERIAL=''
				}
				var SPEC_LOAD_CODE=data[i].SPEC_LOAD_CODE
				if(SPEC_LOAD_CODE==null || SPEC_LOAD_CODE=='null' ||  SPEC_LOAD_CODE=='undefined' || SPEC_LOAD_CODE==undefined || SPEC_LOAD_CODE=='' )
				{
					SPEC_LOAD_CODE=''
				}
				else
				{
					SPEC_LOAD_CODE="/"+SPEC_LOAD_CODE;	
				}
				var ULD_COMPANY=data[i].ULD_COMPANY
				if(ULD_COMPANY==null || ULD_COMPANY=='null' ||  ULD_COMPANY=='undefined' || ULD_COMPANY==undefined || ULD_COMPANY=='' )
				{
					ULD_COMPANY=''
				}
				var ULD_TYPE=data[i].ULD_TYPE
				if(ULD_TYPE==null || ULD_TYPE=='null' ||  ULD_TYPE=='undefined' || ULD_TYPE==undefined || ULD_TYPE=='' )
				{
					ULD_TYPE=''
				}
				else
				{
					ULD_TYPE=ULD_TYPE.replace('/BLK',''); //字符替换 
					ULD_TYPE=ULD_TYPE+'&nbsp;';
				}
				var bg_class='';
				alerts+=IS_TRANSIT+data[i].LOCATION_ID+':'+data[i].CARGO_ARRAIRPORT+'/'+data[i].LOAD_INFO_CODE+'&nbsp;'+ULD_TYPE+ULD_SERIAL+''+ULD_COMPANY+'/'+data[i].GROSS_LOADED_WEIGHT_KG+'KG'+SPEC_LOAD_CODE+' '
				////////////////此处判断////////////////////////
				GROSS_LOADED_WEIGHT_KGs+=parseFloat(data[i].GROSS_LOADED_WEIGHT_KG);
				Installed_single_id+=';'+data[i].LOCATION_ID
				var Installed_value= IS_TRANSIT+data[i].LOCATION_ID+data[i].CARGO_ARRAIRPORT+data[i].LOAD_INFO_CODE+data[i].ULD_TYPE+data[i].ULD_SERIAL+data[i].ULD_COMPANY+data[i].GROSS_LOADED_WEIGHT_KG+data[i].SPEC_LOAD_CODE
				COMP_NAMEs+='<table width="100%" border="0" cellspacing="0" cellpadding="0"  '+bg_class+' id="'+data[i].LOCATION_ID+'a"><tr><td width="33.3%"  align="center">'+IS_TRANSIT+data[i].LOCATION_ID+':'+data[i].CARGO_ARRAIRPORT+'/'+data[i].LOAD_INFO_CODE+'</td><td width="33.3%"  align="center">'+ULD_TYPE+ULD_SERIAL+'</td><td width="33.3%"  align="center">'+ULD_COMPANY+'/'+data[i].GROSS_LOADED_WEIGHT_KG+'KG'+SPEC_LOAD_CODE+'</td></tr></table>'
			}
		}
		strx+='<div class="ub-ac uinn1 umar-t ub-ver">' 
	    strx+='<div class="ub">'
		strx+='<div class="uc-t ub-f1 zv_h1 zv_issline tx-c " style=" width:50%">'+h+'H</div>'
	    strx+='<div class="uc-t ub-f1 zv_h1 zv_isslinegr tx-c zv_bblue" style=" width:50%">'+GROSS_LOADED_WEIGHT_KGs+'</div>'
		strx+='</div>'
	    strx+='<div class="ub" onclick="DialogBox1(1,\''+alerts+'\',\''+h+'H'+'\',1)">'
		strx+='<div style=" border:1px solid #003079; width:99.5%;line-height:1.8em">'
		strx+=COMP_NAMEs+COMP_NAMEp
		strx+='</div>'
		strx+='</div>'
	   	strx+='</div>'
	}
	$$("version").innerHTML=strx;
	Loading(-1);
}


 function DialogBox1(type,content,title,version)
{
	IC.talkingDataCount("装机单","0020");
	var version_val='-1'
	if(version==1)
	{
		version_val='-2'
	}
	var str = "";
	str +='<div id="alert_coverDiv">';
    str +='</div>';
    str +='<div id="alert_dialogboxout">';
    str +='<div id="alert_dialogbox">';
    str +='<div id="alert_title"  >'+title+'</div>';
    str +='<div id="alert_dialogcontent">'+content+'</div>';
	str +='<div id="alert_down"><div ontouchstart="zy_touch(\'zv-btn-act\')" class="c-blu1 uc-a1" onclick="DialogBox1('+version_val+')" style="width: 50%; color:#fff;text-align:center;margin-left:25% ">关   闭</div></div>';
    str +='</div>';
	$$("alert_DialogBox_html").innerHTML = str;
	if (type == '-1') {
		document.getElementById("alert_coverDiv").style.display = "block";
		var installed =localStorage.getItem("zvDatareload")
		if(installed!=''&&installed!=null&&installed!='undefined'&&installed!=undefined)
		{  
				localStorage.setItem("zvData",installed)
				localStorage.setItem("zvDatareload",'')
		}
		setTimeout('down_DialogBox()',400)
   }
  else  if (type == '-2') {
		document.getElementById("alert_coverDiv").style.display = "block";
		setTimeout('down_DialogBox(1)',400)
   }
   else
	{
		document.getElementById("alert_coverDiv").style.display = "block";
        document.body.style.overflow = "hidden"
        document.getElementById("alert_dialogboxout").style.display = "block";
	}
}	
 function down_DialogBox(type){
 		if(type!=1)
		{
			installed_single()
		}
 	   document.getElementById("alert_coverDiv").style.display = "none";
        document.body.style.overflow = "scroll"
        document.getElementById("alert_dialogboxout").style.display = "none";
 }
</script>
</html>
